package cn.java86.test;

import cn.java86.dao.StudentDao;
import cn.java86.entity.Page;
import cn.java86.entity.Student;
import cn.java86.util.MybatisUtil;
import cn.java86.util.StrUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author oldliu
 * @since 1.0
 */
public class GetStudent {
    public static void main(String[] args) {
        SqlSession s= MybatisUtil.get();
        StudentDao mapper = s.getMapper(StudentDao.class);
        Student stu = mapper.get(1L);
        if(stu!=null) {
            System.out.println("学生信息如下:\n"+stu);
            System.out.println("年级是："+stu.getGname());
        }else{
            System.out.println("没有");
        }
        MybatisUtil.close(s);
    }
}
